package com.intre.open.gwtjpa.data.first.server.spring;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class SpringUtils {
	

		public static WebApplicationContext getContext(HttpServletRequest request) {
			return WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext());
		}

		public static Object getBean(HttpServletRequest request, String beanName) {
			return getContext(request).getBean(beanName);
		}
		
	
}
